/*
 * Created on Jun 12, 2007
 */
package edu.swri.swiftvis.scripting;

import java.util.Iterator;

import sun.org.mozilla.javascript.internal.NativeArray;

public class NativeArrayIterator implements Iterator<Object> {
    public NativeArrayIterator(NativeArray array) {
        na=array;
        size=(int)na.getLength();
    }
    public boolean hasNext() {
        return cnt<size;
    }

    public Object next() {
        cnt++;
        return na.get(cnt-1,null);
    }

    public void remove() {
        throw new UnsupportedOperationException();
    }
    private NativeArray na;
    private int size,cnt;
}